package com.hunt.model.app.nuggets;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 热点板块排行显示
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class BlockShow implements Comparable<BlockShow>{

    private String blockName;

    private String blockCode;

    private String blockHlPercent;

    private String maxStockName;

    private String maxStockHlPercent;

    @Override
    public int compareTo(BlockShow o) {
        Float thisHlPercent = Float.valueOf(this.blockHlPercent.replaceAll("%", ""));
        Float oHlPercent = Float.valueOf(o.blockHlPercent.replaceAll("%", ""));
        if (thisHlPercent - oHlPercent > 0){
            return 1;
        }else if (thisHlPercent - oHlPercent < 0){
            return -1;
        }else{
            return 0;
        }
    }
}
